#ifndef INFANTERIE_H
#define INFANTERIE_H

class Arme;
class Missile;

#include <SFML\Graphics.hpp>
#include <SFML\Window.hpp>
#include "unite.h"
#include "../Arme/arme.h"
#include "../Arme/canon.h"
#include "../Arme/missile.h"
#include "../Arme/roquette.h"
#include "../System/animer.h"

class Infanterie : public Unite
{
    public:
    Infanterie(sf::Vector2f position, std::string image, int nb_image, Arme arme, int sous_type, int equipe);
    Infanterie(sf::Vector2f position, std::string image, int nb_image, Missile arme, int sous_type, int equipe);
    ~Infanterie();
    virtual void Afficher(sf::RenderWindow *app,sf::Vector2f vent, Terrain *terre, Game *jeu, std::vector<sf::Sprite> unite, bool visible);
    void ajouterAngle();
    void retirerAngle();
    void avancer(Terrain *terre);
    void reculer(Terrain *terre);
    void tirer(Game *jeu);
    void SetAnim(bool animer);
    virtual sf::Sprite GetSurface();
    //virtual void SetYRect(float y);
    virtual sf::Vector2f GetRoquettePosition();
    virtual sf::Vector2f GetPosition();
    virtual void AfficherGui(sf::RenderWindow *app);
    virtual bool Evenement(int input, sf::RenderWindow *app, Terrain *m_terre, Game *jeu);

    private:
    Animer m_spriteinfant;
    Arme *m_arme;
    Missile *m_missile;
    sf::Vector2f m_position_viseur, imprecision;
    bool is_sniper, c4_is_active;
    bool sniper_vise, direction_viseurx, direction_viseury;
    sf::Clock clock;
    sf::SoundBuffer m_bufferpas;
    sf::Sound m_soundpas;
    int id_sniper_vise, sniper_degat;
    float time, time_viseur, time_imprecision;
    sf::Texture m_viseur_image, m_viseursnip_image, m_image_c4;
    sf::Sprite m_viseur,m_viseursnip, m_sprite_c4;
    float m_angleviseur, time_c4;
};

#endif
